jQuery(function($){
    
    $('.range').each(function(){
       var cls      = $(this).attr('class');  
       var matches  = cls.split(/([a-zA-Z]+)\-([0-9]+)/g);
       var elem     = $(this).parent(); 
       var options  = {}; 
       var input    = elem.find('input'); 
       elem.append('<div class="uirange"></div>');
       
       for(i in matches){
           i = i * 1; 
           if(matches[i] == 'min'){
               options.min  = matches[i+1]*1;
           } 
           if(matches[i] == 'max'){
               options.max  = matches[i+1]*1;
           } 
       }
       
       options.slide = function(event, ui){
           elem.find('label span').empty().append(ui.value);
           input.val(ui.value);
       }
       options.value = input.val(); 
       options.range = 'min';
       elem.find('.uirange').slider(options); 
       
       elem.find('label span').empty().append(input.val()); 
       input.hide(); 
    });
    
});